<%@ page import="dart.Game" %>
<%
	if (game.harshScale == 0f && !game.harshAndMainPenalties)
		penaltyText = "No Penalties"
	else if (game.harshScale == 0f && game.harshAndMainPenalties)
		penaltyText = "Main only"
	else if (game.harshScale != 0f && !game.harshAndMainPenalties)
			penaltyText = "Harsh only"
		else if (game.harshScale != 0f && game.harshAndMainPenalties)
				penaltyText = "Main and Harsh"

	if (game.bounceBack == null)
		bounceText = "Bust"
	else if (game.bounceBack <= -100000 || 100000 <= game.bounceBack)
	bounceText = "No Bounce Back"
	else
		bounceText = "Bounce back at ${game.bounceBack}"
%>
<html>
<head>
	<title>Continue a Game</title>
	<meta name="layout" content="dart"/>
	<dart:css src="games/show.css"/>
</head>
<body>
<h1>Continue Game?</h1>
<g:if test="${game.status == Game.FINISHING}">
	<p class="important" colspan="2">This game is almost over!</p>
</g:if>
<table cellspacing="0">
	<tr>
		<td>Players</td>
		<td><%=game.playerGames.collect {it.person.displayName}.join(', ')%></td>
	</tr>
	<tr class="odd">
		<td>Date</td>
		<td>${game.date.format('EEEE MMMM d, yyyy')}</td>
	</tr>
	<tr>
		<td>Current Round</td>
		<td>${game.currentRound}</td>
	</tr>
	<tr class="odd">
		<td>Current Player</td>
		<td>${game.playerGames[game.currentPlayer].person.displayName}</td>
	</tr>
	<tr>
		<td>Game Style</td>
		<td>${game.countDown ? 'Count Down' : 'Count Up'}</td>
	</tr>
	<tr class="odd">
		<td>Starting Score</td>
		<td>${game.startingScore}</td>
	</tr>
	<tr>
		<td>Ending Score</td>
		<td>${game.endingScore}</td>
	</tr>
	<tr class="odd">
		<td>Score Limit</td>
		<td>${game.scoreLimit == null ? 'No Limit' : game.scoreLimit}</td>
	</tr>
	<tr>
		<td>Force All Throws?</td>
		<td>${game.forceAllThrows ? 'Yes' : 'No'}</td>
	</tr>
	<tr class="odd">
		<td>Ending Style</td>
		<td>${bounceText}</td>
	</tr>
	<tr>
		<td>Penalties</td>
		<td>${penaltyText}</td>
	</tr>
</table>

<div id="links">
	<g:link class="link continue" controller="gamePlay" id="${game.id}">Continue</g:link>
	<g:link class="link kill" onClick="return confirm('Are you sure?');" action="delete" id="${game.id}">Kill</g:link>
</div>
</body>
</html>
